﻿<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<!DOCTYPE html>
<html>
<head lang="en">
    <style>
	body{background: transparent;}
    </style>
    <meta charset="UTF-8">
    <title></title>

    <base href="/res/<?php echo $language; ?>/" />
    <script type="text/javascript" src="js/jquery/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="js/jquery/jquery.easing.min.js"></script>
    <script type="text/javascript" src="js/plugins/menuListGroup.js"></script>
    <script type="text/javascript" src="js/plugins/listGroup.js"></script>
    <script type="text/javascript" src="js/plugins/cookie.js"></script>
    <script type="text/javascript" src="js/main.js"></script>

    <link type="text/css" rel="stylesheet" href="css/common.css" />
    <link type="text/css" rel="stylesheet" href="css/font.css" />
    <link type="text/css" rel="stylesheet" href="css/main.css" />
</head>
<body>
<div class="leftMenu">
    <button class="btn-black01 hideMenuBtn fontDinproMedium" href="javascript:void(0)"><li class="caretLeft"></li> Hidemenu</button>
    <?php $this->acl_lib->show_menu(); ?>

<!--    // TO DO LANGUAGE-->
    <div class="languageChange fontDinpro">
        Language
        <div class="languageGroup listGroupUp listGroup">
            <a class="btnLeft btnPrimary fontDinpro" data-toggle="dropdown" href="javascript:void(0)" link="">
                English
            </a>
            <a class="btnRight btnPrimary" data-toggle="dropdown" href="javascript:void(0)"><span class="caretBottomWhite"></span></a>
            <ul class="dropDownList fontDinpro">
                <li>
                    <a href="javascript:void(0)" class="fontDinpro">
                        English
                    </a>
                </li>
                <li>
                    <a href="javascript:void(0)" class="fontDinpro" link="javascript:changeLanguage('zh')">
                        简体中文
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <img src="img/main/leftMenuShow.png" alt="showMenu" class="showLeftMenu showHide" />
    <div class="showHide languageChangeImg">
        <div class="changeTitle"></div>
        <div class="changeImg fontDinpros" link="javascript:changeLanguage('zh')">中</div>
        <div class="changeImg fontDinpro cur">En</div>
    </div>
</div>
<div class="mainArea">
    <div class="header">
        <p class="pageTitle fontDinproMedium"><?php echo $this->acl_lib->get_current_parent_menu(); ?></p>
        <div class="headerBtns">
            <a href="<?php echo 'http://www.kick9.com'; ?>" target="_blank" class="fontDinpro headerBtn webBtn">Kick9</a>
            <a href="<?php echo backend_url('login/do_logout'); ?>" onclick="window.parent.location.hash=''" class="fontDinpro headerBtn logoutBtn">Logout</a>
        </div>
        <p class="helloWorld fontDinpro">
            Hello! <span><?php echo $this->user->rname; ?></span>
        </p>
    </div>
    <div class="nav">
        <div class="curBg"></div>
        <?php $this->acl_lib->show_menu_bar(); ?>
    </div>
    <?php $this->load->view(isset($tpl) && $tpl ? $tpl : 'sys_default'); ?>
    <div class="shadow"></div>
</div>
<div class="popUpImg"></div>

<script type="text/javascript">
	$(function(){
		if(<?php echo $this->user==""?0:1; ?>==0){
			window.parent.location = "<?php echo backend_url("/".$this->language); ?>/";
		}else{
			window.parent.location.hash = "#<?php foreach($this->uri->rsegments as $hash){ echo $hash.'/';}?>";
		}
    })
    function changeLanguage(to_language){
        var link = location.href;
        link = link.split(".com/")[0];
        link = link+".com/"+to_language+"/#<?php foreach($this->uri->rsegments as $hash){ echo $hash.'/';}?>";
        window.parent.location.href = link;
    }
</script>
</body>
</html>
